//
//  HZMsinTopicTVC.m
//  糖糖大魔王
//
//  Created by 韩震明 on 15/11/4.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "HZMsinTopicTVC.h"
#define WIDTH self.bottomImageView.frame.size.width
#define HEIGHT self.bottomImageView.frame.size.height

@implementation HZMsinTopicTVC

- (void)dealloc
{
    [_picImageView release];
    [_titleLabel release];
    [_bottomImageView release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self  = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell
{
    self.bottomImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.bottomImageView];
    [_bottomImageView release];
    
    self.picImageView = [[UIImageView alloc] init];
    [self.bottomImageView addSubview:self.picImageView];
    [_picImageView release];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.bottomImageView addSubview:self.titleLabel];
    self.titleLabel.font = [UIFont systemFontOfSize:13.0];
    self.titleLabel.textColor = [UIColor grayColor];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.bottomImageView.frame = CGRectMake(self.contentView.frame.size.width / 41, self.contentView.frame.size.height / 74, 39 * self.contentView.frame.size.width / 41, 72 * self.contentView.frame.size.height / 74);
    self.picImageView.frame = CGRectMake(1 * WIDTH / 82, 2 * HEIGHT / 148, 80 * WIDTH / 82, 104 * HEIGHT / 148);
    self.titleLabel.frame = CGRectMake(0, 106 * HEIGHT / 148, WIDTH, 42 * HEIGHT / 148);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
